package com.quick.user.web;


import com.quick.common.dto.UserInfoDto;
import com.quick.common.result.ResultEntity;
import com.quick.user.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
public class UserController {


    @Autowired
    private IUserService mUserService;

    @PostMapping("/login")
    public ResultEntity<String> login(@RequestBody UserInfoDto user){
        return ResultEntity.ok(mUserService.login(user));
    }


    @PostMapping("/register")
    public ResultEntity<String> register(@RequestBody UserInfoDto user){
        return ResultEntity.ok(mUserService.register(user));
    }


    @GetMapping("/test")
    public String test(){
        return "asfdgf";
    }

}
